//
//@File    :	11.18_stone.cpp
//@Time    :	2021/08/31 21:40:01
//@Auther  :	Sun Sheng
//@Contact :	970340843@qq.com
//@Desc    :	user-defined conversions  
//
//complie with stonewt.cpp

//[todo]11章类型转换没看懂
#include "11.16_stonewt.h"
#include <iostream>
using std::cout;
void display(const Stonewt & st,int n);
int main()
{
    Stonewt incognito=275;//uses constructor to initialize
    Stonewt wolfe(285.7);//same as Stonewt wolfe=285.7
    Stonewt taft(21,8);

    cout<<"The celebrity weighed ";
    incognito.show_stn();
    cout<<"The detective weight ";
    wolfe.show_stn();
    cout<<"The President weight ";
    taft.show_lbs();
    incognito = 276.8; //uses constructor to conversion
    taft=325;          //same as taft=Stonewt(325);
    cout<<"After dinner,the celebrity weighed ";
    incognito.show_stn();
    cout<<"After dinner,the President weighed ";
    taft.show_lbs();
    display(taft,2);
    cout<<"The wrestler weighed even more.\n";
    display(422,2);
    cout<<"No stone left unearned\n";
    system("pause");
    return 0;
}
void display(const Stonewt & st,int n)
{
    for (int i = 0; i < n; i++)
    {
        cout<<"Wow! ";
        st.show_stn();
    }
    
}
